<template>
	<view class="page" :style="themeColor">
		<view class="flex flex-wrap align-center justify-between benben-position-layout flex index_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center index_fd0_0'>
				<person></person>
			</view>
			<view class='flex flex-wrap align-center'>
				<text class='index_fd0_1_c0'>{{name}}</text>
			</view>
			<view class='flex flex-wrap align-center index_fd0_2'>
				
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}">
			<!-- <web-view v-show="webView" :webview-styles="webviewStyles" :fullscreen="false" src="/hybrid/html/1.html" @message="onPostMessage"></web-view> -->
		</view>

		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#6A0002"></u-loading>
			<view class="loading_text">加载中</view>
		</view>
		<block v-else>
			<view style="padding: 24rpx 32rpx;">
				<back></back>
			</view>
			<!-- 选择城市 -->
			<view style="margin-bottom: 24rpx;">
				<country @select="selectCountry"></country>
			</view>
			<view class="flex benben-flex-layout flex-wrap align-center index_flex_1">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd1_0" @change="bannerIndexfd1_0 = $event.detail.current"
						class='flex position-relative index_fd1_0' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'
						indicator-color="rgba(0, 0, 0, .3)" indicator-active-color="#000000">

						<swiper-item class='flex  index_fd1_0' v-for="(v, k) in swiperList" :key="k">
							<image class='index_fd1_0' mode="aspectFill" :src='v.thumb'></image>
						</swiper-item>

					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center index_swiperDotfd1_0">
						<template v-for="(item, index) in (swiperList.length)">
							<view :key="index" v-if="bannerIndexfd1_0 == index"
								class="flex dot selected flex align-center justify-center index_swiperDotSelectedfd1_0">
							</view>
						</template>
					</view>
				</view>
			</view>

			<!-- 选择城市 -->
			<view v-if="countryObject.id">
				<select-city ref="city" :country="countryObject"></select-city>
			</view>
			
			<!-- 发现列表 -->
			<findList ref="find" :is_search="1" :is_source="type"></findList>
		</block>
		<!-- <u-loadmore v-if="last_page > 1" class="loadmore" font-size="24" :status="status" :icon-type="iconType"
			:load-text="loadText" />
		<view class="noData" v-if="list.length == 0 && !isShow">
			<image src="/static/empty/no.png"></image>
			<view>没有用户~</view>
		</view> -->

		<!-- <lotus-address ref="address" v-on:choseVal="choseValue" :lotusAddressData="lotusAddressData"></lotus-address> -->
		
		<!-- 消息悬浮窗 -->
		<news></news>
		
		<!-- 底部页尾 -->
		<page-foot></page-foot>
		
		<view style="height: 120rpx;"></view>
	</view>
</template>
<script>

	import person from "@/components/person/index.vue"
	import country from "@/components/country/index.vue"
	import selectCity from "@/components/selectCity/index.vue"
	import news from "@/components/news/index.vue"
	import pageFoot from "@/components/pageFoot/index.vue"
	import back from "@/components/back/index.vue"
	import findList from "@/components/findList/index.vue"
	export default {
		components: {
			person,
			country,
			selectCity,
			news,
			pageFoot,
			back,
			findList
		},

		data() {
			return {
				"pickerDiy1683704013352": false,
				"bannerIndexfd1_0": 0,
				"swiperList": [],

				"lotusAddressData": {
					visible: false,
					provinceName: '',
					cityName: '',
					townName: '',
				},
				"region": '',
				"is_vip": '', // 是否是会员
				"adList": [], // 广告位

				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
				webviewStyles: {
					width: '1px',
					height: '1px',

				},
				webView: false,
				customStyle: {

				},
				
				countryObject: {
					name: "",
					id: ""
				},  // 选择的国家
				findTabs: [],
				type: "",  // 发现分类
				name: "",
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			count() {
				return this.$store.state.newsCount + Number(this.newsNumber)
			},

		},
		watch: {

		},
		onLoad(options) {
			let {type, name} = options;
			if (type !== undefined) this.type = type;
			if (name !== undefined) this.name = name;
			this.getSwiper();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			if (global.token) {
				// this.getInformation();
				// this.getRegion();
				// this.page = 1;
				// this.is_pull = true;
				// this.isShow = true;
				// this.getList();
			}

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.$refs.find.onPullDownRefreshData();
		},
		// 上拉加载
		onReachBottom() {
			this.$refs.find.onReachBottomData();
		},
		onPageScroll(e) {

		},
		methods: {
			// 首页轮播图
			getSwiper() {
				this.$api.post(global.API_VERSION + '/647ea6649c68a', {
					mark: 'home_banner'
				}).then(res => {
					this.isShow = false;
					if (res.data.code == 1) {
						this.swiperList = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			// 选择国家
			selectCountry(e) {
				this.countryObject = e;
				setTimeout(() => {
					this.$refs.city.getCity();
				}, 200)
			},

		}
	};
</script>
<style lang="scss" scoped>
	
	.find_class {
		margin: 24rpx 32rpx 32rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.find_1 {
			width: 218rpx;
			height: 124rpx;
			// background: url(/static/images/93.png) no-repeat;
			background-repeat: no-repeat;
			background-size: 100% 100%;
			padding: 24rpx;

			.find_1_1 {
				font-size: 28rpx;
				font-weight: bold;
			}
		}

		.find_2 {
			width: 218rpx;
			height: 124rpx;
			background: url(/static/images/94.png) no-repeat;
			background-size: 100% 100%;
			padding: 24rpx;

			.find_2_1 {
				font-size: 28rpx;
				font-weight: bold;
			}

			.find_2_2 {
				font-size: 28rpx;
				font-weight: bold;
			}
		}

		.find_3 {
			width: 218rpx;
			height: 124rpx;
			background: url(/static/images/95.png) no-repeat;
			background-size: 100% 100%;
			padding: 24rpx;

			.find_3_1 {
				font-size: 28rpx;
				font-weight: bold;
			}
		}
	}
	

	.companion {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 686rpx;
		height: 64rpx;
		line-height: 64rpx;
		background: #F8F8F8;
		border-radius: 6px 6px 6px 6px;
		margin: 12rpx 32rpx 28rpx;
		font-size: 24rpx;
		padding: 0 24rpx;
	}

	.headImg {
		width: 40rpx;
		height: 40rpx;
	}

	.headName {
		font-size: 28rpx;
		margin-left: 10rpx;
		max-width: 200rpx;

		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}

	.popup_conter {
		width: 500rpx;
		height: 480rpx;
		position: relative;

		.popup_title {
			height: 224rpx;
			width: 100%;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.popup_value {
			padding: 32rpx 24rpx 0;
			font-size: 30rpx;
			text-align: center;
		}

		.popup_btn {
			padding: 48rpx 24rpx;
			position: absolute;
			left: 0;
			bottom: 0;
			width: 100%;
			text-align: center;
			font-size: 28rpx;
			display: flex;
			justify-content: space-between;

			.popup_btn_1 {
				width: 200rpx;
				height: 56rpx;
				background: #eee;
				line-height: 56rpx;
				border-radius: 8rpx;
			}

			.popup_btn_2 {
				width: 200rpx;
				height: 56rpx;
				background: #6A0002;
				line-height: 56rpx;
				border-radius: 8rpx;
				color: #fff;
			}
		}
	}

	.ad_info {
		padding: 16rpx;
		margin: 0 26rpx 24rpx;
		background: #fff;
		border-radius: 16rpx;

		// scroll-view {
		// 	width: 100%;
		// 	white-space: nowrap;
		// }
		uni-swiper {
			height: 240rpx;
		}

		/deep/.uni-swiper-dot {
			width: 12rpx;
			height: 12rpx;
		}

		.swiper-item {
			display: flex;
			flex-wrap: wrap;
		}

		.ad_item {
			// display: inline-block;
			width: 23%;
			text-align: center;
			margin-right: 2%;

			image {
				width: 100%;
				height: 180rpx;
				margin-bottom: 16rpx;
				border-radius: 16rpx;
			}

			.ad_item_text {
				font-size: 26rpx;
			}
		}
	}

	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: linear-gradient(to bottom, #fff, #f8f8f8);
		background-size: 100% auto !important;
	}

	.index_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background: #fff;
		z-index: 10;
	}

	.index_fd0_2_c1 {
		position: relative;
		top: -15rpx;
		right: 10rpx;
	}

	.index_fd0_2_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.index_fd0_2 {
		width: 250rpx;
		margin: 0rpx 32rpx 0rpx 0rpx;
		justify-content: flex-end;
	}

	.index_fd0_1_c0 {
		color: #333333;
		font-size: 36rpx;
		font-weight: bold;
		font-family: PingFang SC, PingFang SC;
	}

	.index_fd0_0_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 8rpx 0rpx 0rpx;
		transform: translateY(5rpx);
	}

	.index_fd0_0 {
		width: 250rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		line-height: normal;
		box-sizing: border-box;
	}

	.index_flex_1 {
		margin: 16rpx 32rpx 24rpx 32rpx;
	}

	.index_fd1_0 {
		width: 686rpx;
		height: 260rpx;
		border-radius: 16rpx;
	}

	.index_swiperDotUnselectedfd1_0 {
		background: var(--benbenbgColor0);
		width: 12rpx;
		height: 12rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}

	.index_swiperDotSelectedfd1_0 {
		background: var(--benbenbgColor0);
		width: 32rpx;
		height: 12rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		background-size: 100% auto !important;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
	}

	::v-deep .index_swiperDotfd1_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.index_flex_2 {
		padding: 0rpx 26rpx 0rpx 26rpx;
	}

	.index_fd2_0_c0_c4 {
		margin: 8rpx 0rpx 0rpx 0rpx;
		// white-space: nowrap;
		padding-left: 32rpx;
	}

	.index_fd2_0_c0_c2_c3 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 500;
		// margin: 0rpx 6rpx 0rpx 28rpx;
	}

	.index_fd2_0_c0_c2_c1 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 500;
	}

	.index_fd2_0_c0_c2_c0 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 500;
		margin: 0rpx 6rpx 0rpx 0rpx;
	}

	.index_fd2_0_c0_c2 {
		margin: 8rpx 0rpx;
		white-space: nowrap;
		padding-left: 32rpx;
	}

	.index_fd2_0_c0_c1_c1_c1 {
		color: #6A0002;
		font-size: 20rpx;
		font-weight: 500;
		line-height: 31rpx;
	}

	.index_fd2_0_c0_c1_c1_c0 {
		width: 20rpx;
		height: 20rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		// transform: translateY(-2rpx);
	}

	.index_fd2_0_c0_c1_c1 {
		background: #E1CCCC;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		height: 34rpx;
		width: 170rpx;
		// padding: 2rpx 0;
		position: absolute;
		bottom: -8rpx;
		left: 50%;
		transform: translateX(-50%);
		z-index: 2;
	}

	.online_text {
		display: flex;
		position: absolute;
		top: 16rpx;
		right: 16rpx;
	}

	.index_fd2_0_c0_c1_c0 {
		// margin: 0rpx 16rpx 0rpx 0rpx;
		text-align: center;
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		line-height: normal;
		box-sizing: border-box;
	}

	.index_fd2_0_c0_c1 {
		margin: 0rpx 0rpx 16rpx 0rpx;
		padding: 0 16rpx;
	}

	.index_fd2_0_c0_c0_c2_c1 {
		color: #5A912A;
		font-size: 20rpx;
		font-weight: 500;
	}

	.index_fd2_0_c0_c0_c2_c0 {
		background: #5A912A;
		width: 6rpx;
		height: 6rpx;
		border-radius: 3rpx 3rpx 3rpx 3rpx;
		margin: 0rpx 11rpx 0rpx 0rpx;
	}

	.index_fd2_0_c0_c0_c1_c1 {
		color: #BFBFBF;
		font-size: 20rpx;
		font-weight: 500;
	}

	.index_fd2_0_c0_c0_c1_c0 {
		background: rgba(191, 191, 191, 1);
		width: 6rpx;
		height: 6rpx;
		border-radius: 3rpx 3rpx 3rpx 3rpx;
		margin: 0rpx 11rpx 0rpx 0rpx;
	}

	.head_img_view {
		width: 190rpx;
		height: 190rpx;
		margin: 0 auto;
		position: relative;
	}

	.index_fd2_0_c0_c0_c0 {
		width: 100%;
		height: 100%;
		border-radius: 50%;
		// width: 120rpx;
		// height: 120rpx;
		// border-radius: 60rpx 60rpx 60rpx 60rpx;
	}

	.index_fd2_0_c0_c0 {
		margin: 0rpx 0rpx 32rpx 0rpx;
		position: relative;
		padding-top: 42rpx;
	}

	.index_fd2_0_c0 {
		background: var(--benbenbgColor0);
		// background: skyblue;
		margin: 0rpx 6rpx 16rpx 6rpx;
		width: 337rpx;
		background-size: 100% auto !important;
		padding: 0 0 24rpx 0;
		height: 498rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.index_picker3_0_c2 {
		color: #4781f5;
	}

	.index_picker3_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}
</style>